home *** CD-ROM | disk | FTP | other *** search
/ Celestin Apprentice 4 / Apprentice-Release4.iso / Languages / MacGofer 0.22d / MacGofer Sources / parser.c < prev    next >
Encoding:
Text File  |  1993-08-25  |  64.0 KB  |  707 lines  |  [TEXT/MPS ]

  1.     0,   124,   119,   138,
  2.     15,    42,    43,     0,    44,     0,     0,    35,     0,     0,
  3.      0,     0,     0,     0,    69,    71,   121,   123,    45,     0,
  4.    194,    36,    38,    39,    56,    58,    67,     0,    70 };
  5. typedef struct { char *t_name; int t_val; } yytoktype;
  6. #ifndef YYDEBUG
  7. #    define YYDEBUG    0    /* don't allow debugging */
  8. #endif
  9.  
  10. #if YYDEBUG
  11.  
  12. yytoktype yytoks[] =
  13. {
  14.     "EVALEX",    257,
  15.     "SCRIPT",    258,
  16.     "=",    61,
  17.     "COCO",    259,
  18.     "INFIXL",    260,
  19.     "INFIXR",    261,
  20.     "INFIX",    262,
  21.     "FUNARROW",    263,
  22.     "-",    45,
  23.     ",",    44,
  24.     "@",    64,
  25.     "(",    40,
  26.     ")",    41,
  27.     "|",    124,
  28.     ";",    59,
  29.     "UPTO",    264,
  30.     "[",    91,
  31.     "]",    93,
  32.     "CASEXP",    265,
  33.     "OF",    266,
  34.     "IF",    267,
  35.     "THEN",    268,
  36.     "ELSE",    269,
  37.     "WHERE",    270,
  38.     "TYPE",    271,
  39.     "DATA",    272,
  40.     "FROM",    273,
  41.     "\\",    92,
  42.     "~",    126,
  43.     "LET",    274,
  44.     "IN",    275,
  45.     "`",    96,
  46.     "VAROP",    276,
  47.     "VARID",    277,
  48.     "NUMLIT",    278,
  49.     "CHARLIT",    279,
  50.     "STRINGLIT",    280,
  51.     "REPEAT",    281,
  52.     "CONOP",    282,
  53.     "CONID",    283,
  54.     "TCLASS",    284,
  55.     "IMPLIES",    285,
  56.     "TINSTANCE",    286,
  57.     "DO",    287,
  58.     "END",    288,
  59.     "PRIMITIVE",    289,
  60.     "DEFAULT",    290,
  61.     "DERIVING",    291,
  62.     "HIDING",    292,
  63.     "IMPORT",    293,
  64.     "INTERFACE",    294,
  65.     "MODULE",    295,
  66.     "RENAMING",    296,
  67.     "TO",    297,
  68.     "-unknown-",    -1    /* ends search */
  69. };
  70.  
  71. char * yyreds[] =
  72. {
  73.     "-no such reduction-",
  74.     "start : EVALEX exp",
  75.     "start : EVALEX exp wherePart",
  76.     "start : SCRIPT topModule",
  77.     "start : error",
  78.     "topModule : begin topDecls close",
  79.     "topModule : modules",
  80.     "begin : error",
  81.     "topDecls : topDecls ';' topDecl",
  82.     "topDecls : topDecls ';' decl",
  83.     "topDecls : topDecl",
  84.     "topDecls : decl",
  85.     "topDecls : error",
  86.     "modules : modules module",
  87.     "modules : module",
  88.     "module : MODULE modid expspec WHERE '{' topDecls close",
  89.     "module : MODULE error",
  90.     "topDecl : IMPORT modid impspec rename",
  91.     "topDecl : IMPORT error",
  92.     "modid : CONID",
  93.     "modid : STRINGLIT",
  94.     "expspec : /* empty */",
  95.     "expspec : '(' exports ')'",
  96.     "exports : exports ',' export",
  97.     "exports : export",
  98.     "export : entity",
  99.     "export : modid UPTO",
  100.     "impspec : /* empty */",
  101.     "impspec : HIDING '(' imports ')'",
  102.     "impspec : '(' imports0 ')'",
  103.     "imports0 : /* empty */",
  104.     "imports0 : imports",
  105.     "imports : imports ',' entity",
  106.     "imports : entity",
  107.     "rename : /* empty */",
  108.     "rename : RENAMING '(' renamings ')'",
  109.     "renamings : renamings ',' renaming",
  110.     "renamings : renaming",
  111.     "renaming : var TO var",
  112.     "renaming : conid TO conid",
  113.     "entity : var",
  114.     "entity : CONID",
  115.     "entity : CONID '(' UPTO ')'",
  116.     "entity : CONID '(' conids ')'",
  117.     "entity : CONID '(' vars0 ')'",
  118.     "conids : conids ',' conid",
  119.     "conids : conid",
  120.     "vars0 : /* empty */",
  121.     "vars0 : vars",
  122.     "topDecl : TYPE typeLhs '=' type invars",
  123.     "topDecl : DATA typeLhs '=' constrs deriving",
  124.     "typeLhs : typeLhs VARID",
  125.     "typeLhs : CONID",
  126.     "typeLhs : error",
  127.     "invars : IN rsvars",
  128.     "invars : /* empty */",
  129.     "rsvars : rsvars ',' rsvar",
  130.     "rsvars : rsvar",
  131.     "rsvar : var COCO sigType",
  132.     "rsvar : var",
  133.     "constrs : constrs '|' constr",
  134.     "constrs : constr",
  135.     "constr : type CONOP type",
  136.     "constr : type",
  137.     "constr : error",
  138.     "deriving : /* empty */",
  139.     "deriving : DERIVING CONID",
  140.     "deriving : DERIVING '(' derivs0 ')'",
  141.     "derivs0 : /* empty */",
  142.     "derivs0 : derivs",
  143.     "derivs : derivs ',' CONID",
  144.     "derivs : CONID",
  145.     "sigType : context IMPLIES type",
  146.     "sigType : type",
  147.     "context : type",
  148.     "type : ctype",
  149.     "type : ctype FUNARROW type",
  150.     "type : error",
  151.     "ctype : ctype atype",
  152.     "ctype : atype",
  153.     "atype : VARID",
  154.     "atype : CONID",
  155.     "atype : '(' ')'",
  156.     "atype : '(' FUNARROW ')'",
  157.     "atype : '(' type ')'",
  158.     "atype : '(' tupCommas ')'",
  159.     "atype : '(' typeTuple ')'",
  160.     "atype : '[' type ']'",
  161.     "atype : '[' ']'",
  162.     "tupCommas : tupCommas ','",
  163.     "tupCommas : ','",
  164.     "typeTuple : typeTuple ',' type",
  165.     "typeTuple : type ',' type",
  166.     "topDecl : INFIXL optdigit ops",
  167.     "topDecl : INFIXR optdigit ops",
  168.     "topDecl : INFIX optdigit ops",
  169.     "optdigit : NUMLIT",
  170.     "optdigit : /* empty */",
  171.     "ops : ops ',' op",
  172.     "ops : op",
  173.     "op : varop",
  174.     "op : conop",
  175.     "op : '-'",
  176.     "varop : VAROP",
  177.     "varop : '`' VARID '`'",
  178.     "conop : CONOP",
  179.     "conop : '`' CONID '`'",
  180.     "topDecl : PRIMITIVE prims COCO type",
  181.     "prims : prims ',' prim",
  182.     "prims : prim",
  183.     "prims : error",
  184.     "prim : var STRINGLIT",
  185.     "topDecl : TCLASS classHead classBody",
  186.     "topDecl : TINSTANCE classHead instBody",
  187.     "topDecl : DEFAULT type",
  188.     "classHead : context IMPLIES type",
  189.     "classHead : type",
  190.     "classBody : WHERE '{' csigdecls close",
  191.     "classBody : /* empty */",
  192.     "instBody : WHERE '{' decls close",
  193.     "instBody : /* empty */",
  194.     "csigdecls : csigdecls ';' csigdecl",
  195.     "csigdecls : csigdecl",
  196.     "csigdecl : vars COCO type",
  197.     "csigdecl : opExp rhs",
  198.     "decl : vars COCO sigType",
  199.     "decl : opExp rhs",
  200.     "decls : decls ';' decl",
  201.     "decls : decl",
  202.     "rhs : rhs1 wherePart",
  203.     "rhs : rhs1",
  204.     "rhs : error",
  205.     "rhs1 : '=' exp",
  206.     "rhs1 : gdefs",
  207.     "wherePart : WHERE '{' decls close",
  208.     "gdefs : gdefs gdef",
  209.     "gdefs : gdef",
  210.     "gdef : '|' exp '=' exp",
  211.     "gdef : '=' exp ',' IF exp",
  212.     "gdef : '=' exp ',' exp",
  213.     "vars : vars ',' var",
  214.     "vars : var",
  215.     "var : varid",
  216.     "var : '(' '-' ')'",
  217.     "varid : VARID",
  218.     "varid : '(' VAROP ')'",
  219.     "conid : CONID",
  220.     "conid : '(' CONOP ')'",
  221.     "exp : opExp COCO sigType",
  222.     "exp : opExp",
  223.     "exp : error",
  224.     "opExp : pfxExp",
  225.     "opExp : pfxExp op pfxExp",
  226.     "opExp : opExp0",
  227.     "opExp0 : opExp0 op pfxExp",
  228.     "opExp0 : pfxExp op pfxExp op pfxExp",
  229.     "pfxExp : '-' appExp",
  230.     "pfxExp : '\\' pats FUNARROW exp",
  231.     "pfxExp : LET '{' decls close IN exp",
  232.     "pfxExp : IF exp THEN exp ELSE exp",
  233.     "pfxExp : CASEXP exp OF '{' alts close",
  234.     "pfxExp : appExp",
  235.     "pats : pats atomic",
  236.     "pats : atomic",
  237.     "appExp : appExp atomic",
  238.     "appExp : atomic",
  239.     "atomic : var",
  240.     "atomic : var '@' atomic",
  241.     "atomic : '~' atomic",
  242.     "atomic : '_'",
  243.     "atomic : conid",
  244.     "atomic : '(' ')'",
  245.     "atomic : NUMLIT",
  246.     "atomic : CHARLIT",
  247.     "atomic : STRINGLIT",
  248.     "atomic : REPEAT",
  249.     "atomic : '(' exp ')'",
  250.     "atomic : '(' exps2 ')'",
  251.     "atomic : '[' list ']'",
  252.     "atomic : '(' pfxExp op ')'",
  253.     "atomic : '(' varop atomic ')'",
  254.     "atomic : '(' conop atomic ')'",
  255.     "exps2 : exps2 ',' exp",
  256.     "exps2 : exp ',' exp",
  257.     "alts : alts ';' alt",
  258.     "alts : alt",
  259.     "alt : opExp altRhs",
  260.     "altRhs : altRhs1 wherePart",
  261.     "altRhs : altRhs1",
  262.     "altRhs1 : guardAlts",
  263.     "altRhs1 : FUNARROW exp",
  264.     "altRhs1 : error",
  265.     "guardAlts : guardAlts guardAlt",
  266.     "guardAlts : guardAlt",
  267.     "guardAlt : '|' opExp FUNARROW exp",
  268.     "list : /* empty */",
  269.     "list : exp",
  270.     "list : exps2",
  271.     "list : exp '|' quals",
  272.     "list : exp UPTO exp",
  273.     "list : exp ',' exp UPTO",
  274.     "list : exp UPTO",
  275.     "list : exp ',' exp UPTO exp",
  276.     "quals : quals ',' qual",
  277.     "quals : qual",
  278.     "qual : exp FROM exp",
  279.     "qual : exp '=' exp",
  280.     "qual : exp",
  281.     "qual : LET '{' decls close",
  282.     "pfxExp : DO '{' dquals close IN exp",
  283.     "pfxExp : DO '{' dquals close END",
  284.     "dquals : dquals ';' dqual",
  285.     "dquals : dqual",
  286.     "dqual : exp FROM exp",
  287.     "dqual : exp",
  288.     "dqual : IF exp",
  289.     "dqual : LET '{' decls close",
  290.     "close : ';' close1",
  291.     "close : close1",
  292.     "close1 : '}'",
  293.     "close1 : error",
  294. };
  295. #endif /* YYDEBUG */
  296. #line 1 "/usr/lib/yaccpar"
  297. /*    @(#)yaccpar 1.10 89/04/04 SMI; from S5R3 1.10    */
  298.  
  299. /*
  300. ** Skeleton parser driver for yacc output
  301. */
  302.  
  303. /*
  304. ** yacc user known macros and defines
  305. */
  306. #define YYERROR        goto yyerrlab
  307. #define YYACCEPT    { free(yys); free(yyv); return(0); }
  308. #define YYABORT        { free(yys); free(yyv); return(1); }
  309. #define YYBACKUP( newtoken, newvalue )\
  310. {\
  311.     if ( yychar >= 0 || ( yyr2[ yytmp ] >> 1 ) != 1 )\
  312.     {\
  313.         yyerror( "syntax error - cannot backup" );\
  314.         goto yyerrlab;\
  315.     }\
  316.     yychar = newtoken;\
  317.     yystate = *yyps;\
  318.     yylval = newvalue;\
  319.     goto yynewstate;\
  320. }
  321. #define YYRECOVERING()    (!!yyerrflag)
  322. #ifndef YYDEBUG
  323. #    define YYDEBUG    1    /* make debugging available */
  324. #endif
  325.  
  326. /*
  327. ** user known globals
  328. */
  329. int yydebug;            /* set to 1 to get debugging */
  330.  
  331. /*
  332. ** driver internal defines
  333. */
  334. #define YYFLAG        (-1000)
  335.  
  336. /*
  337. ** static variables used by the parser
  338. */
  339. static YYSTYPE *yyv;            /* value stack */
  340. static int *yys;            /* state stack */
  341.  
  342. static YYSTYPE *yypv;            /* top of value stack */
  343. static int *yyps;            /* top of state stack */
  344.  
  345. static int yystate;            /* current state */
  346. static int yytmp;            /* extra var (lasts between blocks) */
  347.  
  348. int yynerrs;            /* number of errors */
  349.  
  350. int yyerrflag;            /* error recovery flag */
  351. int yychar;            /* current input token number */
  352.  
  353.  
  354. /*
  355. ** yyparse - retu-1],yypvt[-0]); sp-=3;} break;
  356. case 113:
  357. # line 283 "parser.y"
  358. {instDefn(intOf(yypvt[-2]),yypvt[-1],yypvt[-0]);  sp-=3;} break;
  359. case 114:
  360. # line 284 "parser.y"
  361. {sp-=2;} break;
  362. case 115:
  363. # line 286 "parser.y"
  364. {yyval = gc3(pair(yypvt[-2],checkClass(yypvt[-0])));} break;
  365. case 116:
  366. # line 287 "parser.y"
  367. {yyval = gc1(pair(NIL,checkClass(yypvt[-0])));} break;
  368. case 117:
  369. # line 289 "parser.y"
  370. {yyval = gc4(yypvt[-1]);} break;
  371. case 118:
  372. # line 290 "parser.y"
  373. {yyval = gc0(NIL);} break;
  374. case 119:
  375. # line 292 "parser.y"
  376. {yyval = gc4(yypvt[-1]);} break;
  377. case 120:
  378. # line 293 "parser.y"
  379. {yyval = gc0(NIL);} break;
  380. case 121:
  381. # line 295 "parser.y"
  382. {yyval = gc3(cons(yypvt[-0],yypvt[-2]));} break;
  383. case 122:
  384. # line 296 "parser.y"
  385. {yyval = gc1(cons(yypvt[-0],NIL));} break;
  386. case 123:
  387. # line 298 "parser.y"
  388. {yyval = gc3(sigdecl(yypvt[-1],yypvt[-2],yypvt[-0]));} break;
  389. case 124:
  390. # line 299 "parser.y"
  391. {yyval = gc2(pair(yypvt[-1],yypvt[-0]));} break;
  392. case 125:
  393. # line 304 "parser.y"
  394. {yyval = gc3(sigdecl(yypvt[-1],yypvt[-2],yypvt[-0]));} break;
  395. case 126:
  396. # line 305 "parser.y"
  397. {yyval = gc2(pair(yypvt[-1],yypvt[-0]));} break;
  398. case 127:
  399. # line 307 "parser.y"
  400. {yyval = gc3(cons(yypvt[-0],yypvt[-2]));} break;
  401. case 128:
  402. # line 308 "parser.y"
  403. {yyval = gc1(cons(yypvt[-0],NIL));} break;
  404. case 129:
  405. # line 310 "parser.y"
  406. {yyval = gc2(letrec(yypvt[-0],yypvt[-1]));} break;
  407. case 130:
  408. # line 311 "parser.y"
  409. {yyval = yypvt[-0];} break;
  410. case 131:
  411. # line 312 "parser.y"
  412. {syntaxError("declaration");} break;
  413. case 132:
  414. # line 314 "parser.y"
  415. {yyval = gc2(pair(yypvt[-1],yypvt[-0]));} break;
  416. case 133:
  417. # line 315 "parser.y"
  418. {yyval = gc1(grded(rev(yypvt[-0])));} break;
  419. case 134:
  420. # line 317 "parser.y"
  421. {yyval = gc4(yypvt[-1]);} break;
  422. case 135:
  423. # line 319 "parser.y"
  424. {yyval = gc2(cons(yypvt[-0],yypvt[-1]));} break;
  425. case 136:
  426. # line 320 "parser.y"
  427. {yyval = gc1(cons(yypvt[-0],NIL));} break;
  428. case 137:
  429. # line 322 "parser.y"
  430. {yyval = gc4(pair(yypvt[-1],pair(yypvt[-2],yypvt[-0])));} break;
  431. case 138:
  432. # line 329 "parser.y"
  433. {yyval = gc5(pair(yypvt[-4],pair(yypvt[-0],yypvt[-3])));} break;
  434. case 139:
  435. # line 330 "parser.y"
  436. {yyval = gc4(pair(yypvt[-3],pair(yypvt[-0],yypvt[-2])));} break;
  437. case 140:
  438. # line 332 "parser.y"
  439. {yyval = gc3(cons(yypvt[-0],yypvt[-2]));} break;
  440. case 141:
  441. # line 333 "parser.y"
  442. {yyval = gc1(cons(yypvt[-0],NIL));} break;
  443. case 142:
  444. # line 335 "parser.y"
  445. {yyval = yypvt[-0];} break;
  446. case 143:
  447. # line 336 "parser.y"
  448. {yyval = gc3(varMinus);} break;
  449. case 144:
  450. # line 338 "parser.y"
  451. {yyval = yypvt[-0];} break;
  452. case 145:
  453. # line 339 "parser.y"
  454. {yyval = gc3(yypvt[-1]);} break;
  455. case 146:
  456. # line 341 "parser.y"
  457. {yyval = yypvt[-0];} break;
  458. case 147:
  459. # line 342 "parser.y"
  460. {yyval = gc3(yypvt[-1]);} break;
  461. case 148:
  462. # line 347 "parser.y"
  463. {yyval = gc3(ap(ESIGN,pair(yypvt[-2],yypvt[-0])));} break;
  464. case 149:
  465. # line 348 "parser.y"
  466. {yyval = yypvt[-0];} break;
  467. case 150:
  468. # line 349 "parser.y"
  469. {syntaxError("expression");} break;
  470. case 151:
  471. # line 351 "parser.y"
  472. {yyval = yypvt[-0];} break;
  473. case 152:
  474. # line 352 "parser.y"
  475. {yyval = gc3(ap(ap(yypvt[-1],yypvt[-2]),yypvt[-0]));} break;
  476. case 153:
  477. # line 353 "parser.y"
  478. {yyval = gc1(tidyInfix(yypvt[-0]));} break;
  479. case 154:
  480. # line 355 "parser.y"
  481. {yyval = gc3(ap(ap(yypvt[-1],yypvt[-2]),yypvt[-0]));} break;
  482. case 155:
  483. # line 356 "parser.y"
  484. {yyval = gc5(ap(ap(yypvt[-1],
  485.                             ap(ap(yypvt[-3],singleton(yypvt[-4])),
  486.                                                            yypvt[-2])),yypvt[-0]));} break;
  487. case 156:
  488. # line 360 "parser.y"
  489. {if (isInt(yypvt[-0]))
  490.                          yyval = gc2(mkInt(-intOf(yypvt[-0])));
  491.                      else
  492.                          yyval = gc2(ap(varNegate,yypvt[-0]));
  493.                     } break;
  494. case 157:
  495. # line 365 "parser.y"
  496. {yyval = gc4(ap(LAMBDA,
  497.                              pair(rev(yypvt[-2]),
  498.                                   pair(yypvt[-1],yypvt[-0]))));} break;
  499. case 158:
  500. # line 368 "parser.y"
  501. {yyval = gc6(letrec(yypvt[-3],yypvt[-0]));} break;
  502. case 159:
  503. # line 369 "parser.y"
  504. {yyval = gc6(ap(COND,triple(yypvt[-4],yypvt[-2],yypvt[-0])));} break;
  505. case 160:
  506. # line 370 "parser.y"
  507. {yyval = gc6(ap(CASE,pair(yypvt[-4],rev(yypvt[-1]))));} break;
  508. case 161:
  509. # line 371 "parser.y"
  510. {yyval = yypvt[-0];} break;
  511. case 162:
  512. # line 373 "parser.y"
  513. {yyval = gc2(cons(yypvt[-0],yypvt[-1]));} break;
  514. case 163:
  515. # line 374 "parser.y"
  516. {yyval = gc1(cons(yypvt[-0],NIL));} break;
  517. case 164:
  518. # line 376 "parser.y"
  519. {yyval = gc2(ap(yypvt[-1],yypvt[-0]));} break;
  520. case 165:
  521. # line 377 "parser.y"
  522. {yyval = yypvt[-0];} break;
  523. case 166:
  524. # line 379 "parser.y"
  525. {yyval = yypvt[-0];} break;
  526. case 167:
  527. # line 380 "parser.y"
  528. {yyval = gc3(ap(ASPAT,pair(yypvt[-2],yypvt[-0])));} break;
  529. case 168:
  530. # line 381 "parser.y"
  531. {yyval = gc2(ap(LAZYPAT,yypvt[-0]));} break;
  532. case 169:
  533. # line 382 "parser.y"
  534. {yyval = gc1(WILDCARD);} break;
  535. case 170:
  536. # line 383 "parser.y"
  537. {yyval = yypvt[-0];} break;
  538. case 171:
  539. # line 384 "parser.y"
  540. {yyval = gc2(UNIT);} break;
  541. case 172:
  542. # line 385 "parser.y"
  543. {yyval = yypvt[-0];} break;
  544. case 173:
  545. # line 386 "parser.y"
  546. {yyval = yypvt[-0];} break;
  547. case 174:
  548. # line 387 "parser.y"
  549. {yyval = yypvt[-0];} break;
  550. case 175:
  551. # line 388 "parser.y"
  552. {yyval = yypvt[-0];} break;
  553. case 176:
  554. # line 389 "parser.y"
  555. {yyval = gc3(yypvt[-1]);} break;
  556. case 177:
  557. # line 390 "parser.y"
  558. {yyval = gc3(buildTuple(yypvt[-1]));} break;
  559. case 178:
  560. # line 391 "parser.y"
  561. {yyval = gc3(yypvt[-1]);} break;
  562. case 179:
  563. # line 392 "parser.y"
  564. {yyval = gc4(ap(yypvt[-1],yypvt[-2]));} break;
  565. case 180:
  566. # line 393 "parser.y"
  567. {yyval = gc4(ap(ap(varFlip,yypvt[-2]),yypvt[-1]));} break;
  568. case 181:
  569. # line 394 "parser.y"
  570. {yyval = gc4(ap(ap(varFlip,yypvt[-2]),yypvt[-1]));} break;
  571. case 182:
  572. # line 396 "parser.y"
  573. {yyval = gc3(cons(yypvt[-0],yypvt[-2]));} break;
  574. case 183:
  575. # line 397 "parser.y"
  576. {yyval = gc3(cons(yypvt[-0],cons(yypvt[-2],NIL)));} break;
  577. case 184:
  578. # line 399 "parser.y"
  579. {yyval = gc3(cons(yypvt[-0],yypvt[-2]));} break;
  580. case 185:
  581. # line 400 "parser.y"
  582. {yyval = gc1(cons(yypvt[-0],NIL));} break;
  583. case 186:
  584. # line 402 "parser.y"
  585. {yyval = gc2(pair(yypvt[-1],yypvt[-0]));} break;
  586. case 187:
  587. # line 404 "parser.y"
  588. {yyval = gc2(letrec(yypvt[-0],yypvt[-1]));} break;
  589. case 188:
  590. # line 405 "parser.y"
  591. {yyval = yypvt[-0];} break;
  592. case 189:
  593. # line 407 "parser.y"
  594. {yyval = gc1(grded(rev(yypvt[-0])));} break;
  595. case 190:
  596. # line 408 "parser.y"
  597. {yyval = gc2(pair(yypvt[-1],yypvt[-0]));} break;
  598. case 191:
  599. # line 409 "parser.y"
  600. {syntaxError("case expression");} break;
  601. case 192:
  602. # line 411 "parser.y"
  603. {yyval = gc2(cons(yypvt[-0],yypvt[-1]));} break;
  604. case 193:
  605. # line 412 "parser.y"
  606. {yyval = gc1(cons(yypvt[-0],NIL));} break;
  607. case 194:
  608. # line 414 "parser.y"
  609. {yyval = gc4(pair(yypvt[-1],pair(yypvt[-2],yypvt[-0])));} break;
  610. case 195:
  611. # line 419 "parser.y"
  612. {yyval = gc0(nameNil);} break;
  613. case 196:
  614. # line 420 "parser.y"
  615. {yyval = gc1(ap(FINLIST,cons(yypvt[-0],NIL)));} break;
  616. case 197:
  617. # line 421 "parser.y"
  618. {yyval = gc1(ap(FINLIST,rev(yypvt[-0])));} break;
  619. case 198:
  620. # line 422 "parser.y"
  621. {yyval = gc3(ap(COMP,pair(yypvt[-2],rev(yypvt[-0]))));} break;
  622. case 199:
  623. # line 423 "parser.y"
  624. {yyval = gc3(ap(ap(varFromTo,yypvt[-2]),yypvt[-0]));} break;
  625. case 200:
  626. # line 424 "parser.y"
  627. {yyval = gc4(ap(ap(varFromThen,yypvt[-3]),yypvt[-1]));} break;
  628. case 201:
  629. # line 425 "parser.y"
  630. {yyval = gc2(ap(varFrom,yypvt[-1]));} break;
  631. case 202:
  632. # line 426 "parser.y"
  633. {yyval = gc5(ap(ap(ap(varFromThenTo,
  634.                                                                yypvt[-4]),yypvt[-2]),yypvt[-0]));} break;
  635. case 203:
  636. # line 429 "parser.y"
  637. {yyval = gc3(cons(yypvt[-0],yypvt[-2]));} break;
  638. case 204:
  639. # line 430 "parser.y"
  640. {yyval = gc1(cons(yypvt[-0],NIL));} break;
  641. case 205:
  642. # line 432 "parser.y"
  643. {yyval = gc3(ap(FROMQUAL,pair(yypvt[-2],yypvt[-0])));} break;
  644. case 206:
  645. # line 433 "parser.y"
  646. {yyval = gc3(ap(QWHERE,
  647.                              singleton(
  648.                             pair(yypvt[-2],pair(yypvt[-1],
  649.                                      yypvt[-0])))));} break;
  650. case 207:
  651. # line 437 "parser.y"
  652. {yyval = gc1(ap(BOOLQUAL,yypvt[-0]));} break;
  653. case 208:
  654. # line 438 "parser.y"
  655. {yyval = gc4(ap(QWHERE,yypvt[-1]));} break;
  656. case 209:
  657. # line 478 "parser.y"
  658. {yyval = gc6(ap(COMP,pair(yypvt[-0],rev(yypvt[-3]))));} break;
  659. case 210:
  660. # line 479 "parser.y"
  661. {yyval = gc5(ap(COMP,pair(UNIT,rev(yypvt[-2]))));} break;
  662. case 211:
  663. # line 481 "parser.y"
  664. {yyval = gc3(cons(yypvt[-0],yypvt[-2]));} break;
  665. case 212:
  666. # line 482 "parser.y"
  667. {yyval = gc1(cons(yypvt[-0],NIL));} break;
  668. case 213:
  669. # line 484 "parser.y"
  670. {yyval = gc3(ap(FROMQUAL,pair(yypvt[-2],yypvt[-0])));} break;
  671. case 214:
  672. # line 485 "parser.y"
  673. {yyval = gc1(ap(FROMQUAL,
  674.                              pair(WILDCARD,yypvt[-0])));} break;
  675. case 215:
  676. # line 487 "parser.y"
  677. {yyval = gc2(ap(BOOLQUAL,yypvt[-0]));} break;
  678. case 216:
  679. # line 488 "parser.y"
  680. {yyval = gc4(ap(QWHERE,yypvt[-1]));} break;
  681. case 217:
  682. # line 494 "parser.y"
  683. {yyval = gc2(yypvt[-0]);} break;
  684. case 218:
  685. # line 495 "parser.y"
  686. {yyval = yypvt[-0];} break;
  687. case 219:
  688. # line 497 "parser.y"
  689. {yyval = yypvt[-0];} break;
  690. case 220:
  691. # line 498 "parser.y"
  692. {yyerrok;
  693.                                          if (canUnOffside()) {
  694.                                              unOffside();
  695.                          /* insert extra token on stack*/
  696.                          push(NIL);
  697.                          pushed(0) = pushed(1);
  698.                          pushed(1) = mkInt(column);
  699.                      }
  700.                                          else
  701.                                              syntaxError("definition");
  702.                                         } break;
  703.     }
  704.     goto yystack;        /* reset registers in driver code */
  705. }
  706.  
  707.